package ade.prime.model;

import ade.prime.activity.R;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author		Schnell Michaël
 */
public enum Project implements Parcelable {

	UHP(1, R.string.CreateSchedule_project_id_UHP), 
	ESIAL(2, R.string.CreateSchedule_project_id_ESIAL),
	PROJET_PRINCIPAL(5, R.string.CreateSchedule_project_id_PROJET), ;
	
	private int adeProjectId ;
	
	private int textId ;
	
	/**
	 * @param textId
	 */
	private Project(int adeProjectId, int textId) {
		this.adeProjectId = adeProjectId ;
		this.textId = textId;
	}
	
	/**
	 * @return the textId
	 */
	public int getTextId() {
		return this.textId;
	}
	
	/**
	 * @return the adeProjectId
	 */
	public int getAdeProjectId() {
		return this.adeProjectId;
	}

	public static final Parcelable.Creator<Project> CREATOR = new Creator<Project>() {
		
		@Override
		public Project[] newArray(int size) {
			return new Project[size] ;
		}// newArray(int)
		
		@Override
		public Project createFromParcel(Parcel source) {
			String name = source.readString() ;
			return Project.valueOf(name) ;
		}// createFromParcel(Parcel)
		
	} ;

	@Override
	public int describeContents() {
		return 0 ;
	}// describeContents()

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(this.name()) ;
	}// writeToParcel(Parcel, int)

}// enum Project